package com.abei.gas.controller;


import com.abei.gas.entity.Payorder;
import com.abei.gas.entity.Projectorder;
import com.abei.gas.service.ProjectorderService;
import com.abei.gas.vo.DataVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/projectorder")
@Api(tags = "报装管理相关接口")
public class ProjectorderController {
    @Autowired
    private ProjectorderService projectorderService;

    @PostMapping("/insert")
    public DataVo insert(@RequestBody Projectorder projectorder){
        projectorderService.save(projectorder);
        return DataVo.success();
    }

    @DeleteMapping("/deleteById")
    public DataVo deleteById(@RequestBody List<String> ids){
        projectorderService.removeByIds(ids);
        return DataVo.success();
    }

    @PutMapping("/update")
    public DataVo update (@RequestBody Projectorder projectorder){
        projectorderService.updateById(projectorder);
        return DataVo.success();
    }

    @GetMapping("/findAll")
    public DataVo<Projectorder> findAll(Integer page, Integer limit){
        return projectorderService.findAll(page,limit);
    }
}
